/** Scaled & spinning object derived from Object
**
** @version: $Id: SpinningObject.h 64 2010-11-25 20:46:39Z NeurobaticsTim@gmail.com $
*/
#pragma once

#include "Object.h"


/******************************************************************************\
*                           Spinning Object class                              *
\******************************************************************************/
class SpinningObject : public Object
{
protected:
	/*****************************************************\
	* Member variables                                    *
	\*****************************************************/
	bool	m_bSpinning;		// currently spinning?
	float	m_fAngularVelocity;	// how fast and in which direction (+ or -)?
	float	m_fAngle;			// for display rotation


	/*****************************************************\
	* Update world transform                              *
	\*****************************************************/
	virtual void UpdateWorldTransform();

public:
	/*****************************************************\
	* Spinning Object constructor                         *
	\*****************************************************/
	SpinningObject(const D3DXVECTOR3& cvPosition);

	/*****************************************************\
	* Destructor                                          *
	\*****************************************************/
	virtual ~SpinningObject();

	/*****************************************************\
	* How fast and in which direction does it spin?       *
	\*****************************************************/
	void SetSpinRate(const float fSpinRate);

	/*****************************************************\
	* Turn spinning on/off                                *
	\*****************************************************/
	void SetSpinning(const bool bSpinning);

	/*****************************************************\
	* Update each frame                                   *
	\*****************************************************/
	virtual bool Update(const double cdDeltaTime);
};
